package com.tanhua.server.controller;

import com.tanhua.server.service.TaoHuaService;
import com.tanhua.server.vo.AudioVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/*
桃花传音
 */
@RestController
@RequestMapping("/peachblossom")
public class TaoHuaCollection {

    @Autowired
    private TaoHuaService taoHuaService;

    /**
     * 发送语言
     *
     * @param multipartFile
     * @return
     */
    @PostMapping
    public Object sendSound(@RequestParam("soundFile") MultipartFile multipartFile) {
        return this.taoHuaService.sendSound(multipartFile);
    }

    /**
     * 接收语音
     *
     * @return
     */
    @GetMapping
    public Object getSound() {
        return this.taoHuaService.getSound();
    }
}
